import { Button } from "antd";
import React, { memo, useEffect } from "react";

function Child({
  text,
  setChildCount,
  childCount,
  onChange,
}: {
  text: string;
  setChildCount?: any;
  childCount: any;
  onChange: any;
}) {
  useEffect(() => {
    console.log("是否重新执行");
  }, []);
  console.log("------是否重新执行");

  return (
    <div>
      {" "}
      <Button
        onClick={() => {
          onChange();
          setChildCount(null);
        }}
      >
        子组件按钮
      </Button>
      <div>{"父亲的文字————————》" + text}</div>
      <div>{"父亲的数字--------》" + childCount.age.a}</div>
    </div>
  );
}
export default memo(Child);
